//
//  addvaluesTableViewCell.m
//  BAOASystem
//
//  Created by michael on 2018/3/19.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "addvaluesTableViewCell.h"

@implementation addvaluesTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
    _namefield = [[zhucetextfield alloc]init];
    _namefield.delegate = self;
    _namefield.frame = CGRectZero;
[self.contentView addSubview:_namefield];
    _valuesfield = [[zhucetextfield alloc]init];
    _valuesfield.delegate = self;
    _valuesfield.frame = CGRectZero;
[self.contentView addSubview:_valuesfield];
}
return self;

}
- (void)setDic:(NSDictionary *)dic{

 _dic = dic;
 _namefield.text = _dic[@"name"];
  _valuesfield.text =  _dic[@"values"];
}
- (void)textFieldDidEndEditing:(UITextField *)textField
{
   [_dic setValue:_namefield.text forKey:@"name"];
   [_dic setValue:_valuesfield.text forKey:@"values"];
}
- (void)layoutSubviews{
[super layoutSubviews];
_namefield.frame = CGRectMake(10, 5,( KScreenWidth-30)/2, 40);
_namefield.placeholder = NSLocalizedString(@"添加商品-商品名(例如:尺寸)", nil);
_valuesfield.placeholder = NSLocalizedString(@"属性值(例如:12寸)", nil);

_valuesfield.frame = CGRectMake(_namefield.right+10, 5,( KScreenWidth-30)/2, 40);

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
